<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.4.0">


  <link rel="apple-touch-icon" sizes="180x180" href="/rjcs/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/rjcs/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/rjcs/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/rjcs/images/logo.svg" color="#222">

<link rel="stylesheet" href="/rjcs/css/main.css">



<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.4/css/all.min.css" integrity="sha256-mUZM63G8m73Mcidfrv5E+Y61y7a12O5mW4ezU3bxqW4=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/animate.css@3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">

<script class="next-config" data-name="main" type="application/json">{"hostname":"raojincs.gitee.io","root":"/rjcs/","images":"/rjcs/images","scheme":"Muse","darkmode":false,"version":"8.8.2","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":false,"bookmark":{"enable":false,"color":"#222","save":"auto"},"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"stickytabs":false,"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果：${query}","hits_time":"找到 ${hits} 个搜索结果（用时 ${time} 毫秒）","hits":"找到 ${hits} 个搜索结果"}}</script><script src="/rjcs/js/config.js"></script>
<meta name="description" content="看详细日志可查看左下角，点击查看更多">
<meta property="og:type" content="website">
<meta property="og:title" content="RoseJoker">
<meta property="og:url" content="https://raojincs.gitee.io/rjcs/index.html">
<meta property="og:site_name" content="RoseJoker">
<meta property="og:description" content="看详细日志可查看左下角，点击查看更多">
<meta property="og:locale" content="zh_CN">
<meta property="article:author" content="CS">
<meta name="twitter:card" content="summary">


<link rel="canonical" href="https://raojincs.gitee.io/rjcs/">



<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":true,"isPost":false,"lang":"zh-CN","comments":"","permalink":"","path":"index.html","title":""}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>RoseJoker</title>
  




  <noscript>
    <link rel="stylesheet" href="/rjcs/css/noscript.css">
  </noscript>
</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏" role="button">
    </div>
  </div>

  <div class="site-meta">

    <a href="/rjcs/" class="brand" rel="start">
      <i class="logo-line"></i>
      <h1 class="site-title">RoseJoker</h1>
      <i class="logo-line"></i>
    </a>
      <p class="site-subtitle" itemprop="description">看详细日志可点击左下角，点击查看更多</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>







</div>
        
  
  <div class="toggle sidebar-toggle" role="button">
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
  </div>

  <aside class="sidebar">

    <div class="sidebar-inner sidebar-overview-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author site-overview-item animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">CS</p>
  <div class="site-description" itemprop="description">看详细日志可查看左下角，点击查看更多</div>
</div>
<div class="site-state-wrap site-overview-item animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/rjcs/archives/">
          <span class="site-state-item-count">3</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
  </nav>
</div>



        </div>
      </div>
    </div>
  </aside>
  <div class="sidebar-dimmer"></div>


    </header>

    
  <div class="back-to-top" role="button" aria-label="返回顶部">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


    <div class="main-inner index posts-expand">

    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://raojincs.gitee.io/rjcs/2021/12/25/art%E4%B8%80%E4%BB%A3%E5%A3%B3%E8%84%B1%E5%A3%B3%E5%88%9D%E8%AF%95/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/rjcs/images/avatar.gif">
      <meta itemprop="name" content="CS">
      <meta itemprop="description" content="看详细日志可查看左下角，点击查看更多">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="RoseJoker">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/rjcs/2021/12/25/art%E4%B8%80%E4%BB%A3%E5%A3%B3%E8%84%B1%E5%A3%B3%E5%88%9D%E8%AF%95/" class="post-title-link" itemprop="url">art一代壳脱壳初试</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>
      

      <time title="创建时间：2021-12-25 12:19:51 / 修改时间：13:12:21" itemprop="dateCreated datePublished" datetime="2021-12-25T12:19:51+08:00">2021-12-25</time>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h2 id="二级标题使用2个"><a href="#二级标题使用2个" class="headerlink" title="二级标题使用2个#"></a>二级标题使用2个#</h2><h2 id="art一代壳脱壳初试"><a href="#art一代壳脱壳初试" class="headerlink" title="art一代壳脱壳初试"></a>art一代壳脱壳初试</h2><p>废话不多说直接讲解思路</p>
<figure class="highlight markdown"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">下载源码后  修改相应的代码在重新编译后  刷到手机上即可</span><br></pre></td></tr></table></figure>

<p>安卓源码在线观看网站</p>
<p><a target="_blank" rel="noopener" href="http://androidxref.com/">http://androidxref.com/</a></p>
<p>以 InMemoryDexClassLoader分析为例</p>
<img src="/rjcs/2021/12/25/art%E4%B8%80%E4%BB%A3%E5%A3%B3%E8%84%B1%E5%A3%B3%E5%88%9D%E8%AF%95/%E5%88%86%E6%9E%90%E6%BA%90%E7%A0%811.jpg" class title="分析源码1">



<img src="/rjcs/2021/12/25/art%E4%B8%80%E4%BB%A3%E5%A3%B3%E8%84%B1%E5%A3%B3%E5%88%9D%E8%AF%95/image-20211225130133878.png" class title="image-20211225130133878">



<img src="/rjcs/2021/12/25/art%E4%B8%80%E4%BB%A3%E5%A3%B3%E8%84%B1%E5%A3%B3%E5%88%9D%E8%AF%95/image-20211225130158716.png" class title="image-20211225130158716">



<img src="/rjcs/2021/12/25/art%E4%B8%80%E4%BB%A3%E5%A3%B3%E8%84%B1%E5%A3%B3%E5%88%9D%E8%AF%95/image-20211225130417205.png" class title="image-20211225130417205">



<img src="/rjcs/2021/12/25/art%E4%B8%80%E4%BB%A3%E5%A3%B3%E8%84%B1%E5%A3%B3%E5%88%9D%E8%AF%95/image-20211225130448928.png" class title="image-20211225130448928">



<img src="/rjcs/2021/12/25/art%E4%B8%80%E4%BB%A3%E5%A3%B3%E8%84%B1%E5%A3%B3%E5%88%9D%E8%AF%95/image-20211225130611285.png" class title="image-20211225130611285">



<img src="/rjcs/2021/12/25/art%E4%B8%80%E4%BB%A3%E5%A3%B3%E8%84%B1%E5%A3%B3%E5%88%9D%E8%AF%95/image-20211225130638982.png" class title="image-20211225130638982">



<p>后面分析  这两个方法底层其实调用了同一个方法</p>
<img src="/rjcs/2021/12/25/art%E4%B8%80%E4%BB%A3%E5%A3%B3%E8%84%B1%E5%A3%B3%E5%88%9D%E8%AF%95/image-20211225130729899.png" class title="image-20211225130729899">



<img src="/rjcs/2021/12/25/art%E4%B8%80%E4%BB%A3%E5%A3%B3%E8%84%B1%E5%A3%B3%E5%88%9D%E8%AF%95/image-20211225130758455.png" class title="image-20211225130758455">





<img src="/rjcs/2021/12/25/art%E4%B8%80%E4%BB%A3%E5%A3%B3%E8%84%B1%E5%A3%B3%E5%88%9D%E8%AF%95/image-20211225130845428.png" class title="image-20211225130845428">





<img src="/rjcs/2021/12/25/art%E4%B8%80%E4%BB%A3%E5%A3%B3%E8%84%B1%E5%A3%B3%E5%88%9D%E8%AF%95/image-20211225131000999.png" class title="image-20211225131000999">



<img src="/rjcs/2021/12/25/art%E4%B8%80%E4%BB%A3%E5%A3%B3%E8%84%B1%E5%A3%B3%E5%88%9D%E8%AF%95/image-20211225131026118.png" class title="image-20211225131026118">



<img src="/rjcs/2021/12/25/art%E4%B8%80%E4%BB%A3%E5%A3%B3%E8%84%B1%E5%A3%B3%E5%88%9D%E8%AF%95/image-20211225131053892.png" class title="image-20211225131053892">



<img src="/rjcs/2021/12/25/art%E4%B8%80%E4%BB%A3%E5%A3%B3%E8%84%B1%E5%A3%B3%E5%88%9D%E8%AF%95/image-20211225131123842.png" class title="image-20211225131123842">



<img src="/rjcs/2021/12/25/art%E4%B8%80%E4%BB%A3%E5%A3%B3%E8%84%B1%E5%A3%B3%E5%88%9D%E8%AF%95/image-20211225131147645.png" class title="image-20211225131147645">



<p>最后这个函数里就有dex的起始地址和大小  </p>

      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://raojincs.gitee.io/rjcs/2021/12/21/%E4%BB%8E%E5%A4%B4%E5%BC%80%E5%A7%8B%E7%BC%96%E8%AF%91%E5%AE%89%E5%8D%93%E6%BA%90%E7%A0%81/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/rjcs/images/avatar.gif">
      <meta itemprop="name" content="CS">
      <meta itemprop="description" content="看详细日志可查看左下角，点击查看更多">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="RoseJoker">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/rjcs/2021/12/21/%E4%BB%8E%E5%A4%B4%E5%BC%80%E5%A7%8B%E7%BC%96%E8%AF%91%E5%AE%89%E5%8D%93%E6%BA%90%E7%A0%81/" class="post-title-link" itemprop="url">从头开始编译安卓源码</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>
      

      <time title="创建时间：2021-12-21 20:11:26 / 修改时间：20:56:49" itemprop="dateCreated datePublished" datetime="2021-12-21T20:11:26+08:00">2021-12-21</time>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h2 id="从0开始编译安卓源码"><a href="#从0开始编译安卓源码" class="headerlink" title="从0开始编译安卓源码"></a>从0开始编译安卓源码</h2><h3 id="基本硬件条件（越高越好，没有的话也可以尝试）"><a href="#基本硬件条件（越高越好，没有的话也可以尝试）" class="headerlink" title="基本硬件条件（越高越好，没有的话也可以尝试）"></a>基本硬件条件（越高越好，没有的话也可以尝试）</h3><figure class="highlight markdown"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">电脑CPU  ： 双核4线程2GHz或者更高配置的CPU</span><br><span class="line">电脑内存  ： 8G</span><br><span class="line">电脑磁盘  ： 至少200G可用的磁盘空间，固态硬盘更好</span><br><span class="line">电脑操作系统：Ubuntu 18  （用其他版本的也可以）</span><br><span class="line">Android手机 ： Google Nexus 6P  （其他部分谷歌手机也可以）</span><br></pre></td></tr></table></figure>



<h3 id="准备ubuntu环境（去官网下载）"><a href="#准备ubuntu环境（去官网下载）" class="headerlink" title="准备ubuntu环境（去官网下载）"></a>准备ubuntu环境（去官网下载）</h3><figure class="highlight markdown"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">sudo apt-get update  //更新</span><br><span class="line">sudo apt-get install openjdk-8-jdk    //安装jdk8</span><br><span class="line">sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip   //安装依赖</span><br><span class="line">sudo apt-get install python-networkx  //如果想使用SELinux tool 则还应该安装 python-networkx</span><br><span class="line">sudo apt-get install libnss-sss:i386   //如果使用LDAP，则还应该安装 libnss-sss:i386 </span><br><span class="line">wget -S -O - http://yunpstatic.oss-cn-beijing.aliyuncs.com/res/android/source/51-android.txt | sed &quot;s/<span class="xml"><span class="tag">&lt;<span class="name">username</span>&gt;</span></span>/$USER/&quot; | sudo tee &gt;/dev/null /etc/udev/rules.d/51-android.rules; sudo udevadm control --reload-rules  //Ubuntu默认不允许普通用户使用USB，所以还应该配置Android USB设备能够被当前用户访问到</span><br></pre></td></tr></table></figure>



<h3 id="下载安卓源码（这里使用的是清华镜像源，有其他途径也可以）"><a href="#下载安卓源码（这里使用的是清华镜像源，有其他途径也可以）" class="headerlink" title="下载安卓源码（这里使用的是清华镜像源，有其他途径也可以）"></a>下载安卓源码（这里使用的是清华镜像源，有其他途径也可以）</h3><p><a target="_blank" rel="noopener" href="https://mirrors.tuna.tsinghua.edu.cn/help/AOSP/">https://mirrors.tuna.tsinghua.edu.cn/help/AOSP/</a></p>
<p>按照网站上的步骤操作</p>
<figure class="highlight markdown"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">mkdir ~/bin            //这几步为下载 repo 工具</span><br><span class="line">PATH=~/bin:$PATH</span><br><span class="line">curl https://storage.googleapis.com/git-repo-downloads/repo &gt; ~/bin/repo</span><br><span class="line">chmod a+x ~/bin/repo</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">mkdir WORKING<span class="emphasis">_DIRECTORY   //创建目录存放源码</span></span><br><span class="line"><span class="emphasis">cd WORKING_</span>DIRECTORY</span><br><span class="line"></span><br><span class="line">repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest -b android-4.0.1<span class="emphasis">_r1    // 初始化源码版本  可以参考下面的网址来选择</span></span><br><span class="line"><span class="emphasis"></span></span><br><span class="line"><span class="emphasis">repo sync     //同步源码</span></span><br></pre></td></tr></table></figure>



<p>您也可以根据自己的需要来选择合适的分支进行下载，分支与匹配机型参考表网址是  （需要翻墙）<br><a target="_blank" rel="noopener" href="http://source.android.com/source/build-numbers.html#source-code-tags-and-builds">http://source.android.com/source/build-numbers.html#source-code-tags-and-builds</a></p>
<h3 id="配置厂商提供的驱动"><a href="#配置厂商提供的驱动" class="headerlink" title="配置厂商提供的驱动"></a>配置厂商提供的驱动</h3><ol>
<li>访问页面 <a target="_blank" rel="noopener" href="https://developers.google.com/android/drivers">https://developers.google.com/android/drivers</a> 查找配置自己机型的驱动（我这里查找的是Nexus 6P的驱动）<br><strong>注意：访问该页面需要翻墙</strong></li>
<li><strong><img src="/rjcs/2021/12/21/%E4%BB%8E%E5%A4%B4%E5%BC%80%E5%A7%8B%E7%BC%96%E8%AF%91%E5%AE%89%E5%8D%93%E6%BA%90%E7%A0%81/%E9%A9%B1%E5%8A%A8.jpg" class title="驱动"></strong></li>
</ol>
<p>3.驱动包文件都是压缩包，在压缩包中包括一个sh文件，该sh文件为自解压脚本，分别将这3个sh文件放在Android源码树的根目录，比如/Work/AndroidSource/Nexus6/source，并执行依次执行这3个文件以自动配置驱动包，配置完成后将在源码树根目录中多出一个vendor目录。<br><strong>注意：在执行3个sh文件时会呈现协议条款，请慢慢看，不要跳过I ACCEPT那一步，否则不解压</strong></p>
<h2 id="编译Android源码"><a href="#编译Android源码" class="headerlink" title="编译Android源码"></a>编译Android源码</h2><figure class="highlight markdown"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">进入源码目录后启动终端</span><br><span class="line">make clobber         //进行清理</span><br><span class="line">source build/envsetup.sh   //加载环境变量</span><br><span class="line">lunch     //选择构建目标 </span><br><span class="line">make -j4    //编译</span><br></pre></td></tr></table></figure>

<p> 编译过程中会出现许多错误  每个人可以根据自己的情况去百度解决问题   每个人都不同</p>
<figure class="highlight markdown"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none</span><br><span class="line">需要export GIT<span class="emphasis">_SSL_</span>NO<span class="emphasis">_VERIFY=1  来关闭系统的认证系统</span></span><br><span class="line"><span class="emphasis"></span></span><br><span class="line"><span class="emphasis">jack-admin相关错误</span></span><br><span class="line"><span class="emphasis">编辑/etc/java-8-openjdk/security/java.security</span></span><br><span class="line"><span class="emphasis">找到TLSv1这行，把TLSv1, TLSv1.1,删除后保存</span></span><br><span class="line"><span class="emphasis">jdk.tls.disabledAlgorithms=SSLv3, TLSv1, TLSv1.1, RC4, DES, MD5withRSA, </span></span><br><span class="line"><span class="emphasis">修改jack.setting 里的SERVER_</span>PORT<span class="emphasis">_SERVICE和SERVER_</span>PORT<span class="emphasis">_ADMIN端口 </span></span><br><span class="line"><span class="emphasis">与config.properties里的jack.server.service.port  jack.server.admin.port一致</span></span><br></pre></td></tr></table></figure>



<img src="/rjcs/2021/12/21/%E4%BB%8E%E5%A4%B4%E5%BC%80%E5%A7%8B%E7%BC%96%E8%AF%91%E5%AE%89%E5%8D%93%E6%BA%90%E7%A0%81/%E6%88%90%E5%8A%9F%E7%BB%93%E6%9E%9C.jpg" class title="成功结果">





<p>后面就可以刷入自己的手机中了</p>

      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://raojincs.gitee.io/rjcs/2021/12/20/%E6%90%AD%E5%BB%BA%E8%87%AA%E5%B7%B1%E7%9A%84%E5%8D%9A%E5%AE%A2/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/rjcs/images/avatar.gif">
      <meta itemprop="name" content="CS">
      <meta itemprop="description" content="看详细日志可查看左下角，点击查看更多">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="RoseJoker">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/rjcs/2021/12/20/%E6%90%AD%E5%BB%BA%E8%87%AA%E5%B7%B1%E7%9A%84%E5%8D%9A%E5%AE%A2/" class="post-title-link" itemprop="url">搭建个人博客</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>
      

      <time title="创建时间：2021-12-20 21:32:24 / 修改时间：22:44:41" itemprop="dateCreated datePublished" datetime="2021-12-20T21:32:24+08:00">2021-12-20</time>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h1 id="搭建个人博客"><a href="#搭建个人博客" class="headerlink" title="搭建个人博客"></a>搭建个人博客</h1><h3 id="1：下载node-js和git-npm-此处不做介绍，自行安装"><a href="#1：下载node-js和git-npm-此处不做介绍，自行安装" class="headerlink" title="1：下载node.js和git,npm(此处不做介绍，自行安装)"></a>1：下载node.js和git,npm(此处不做介绍，自行安装)</h3><h3 id="2-安装hexo"><a href="#2-安装hexo" class="headerlink" title="2: 安装hexo"></a>2: 安装hexo</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-cli -g</span><br><span class="line">hexo init blog      //初始化</span><br><span class="line"><span class="built_in">cd</span> blog</span><br><span class="line">npm install</span><br><span class="line">hexo server    </span><br></pre></td></tr></table></figure>

<p> 想了解的更加详细可以进入hexo官网 <a target="_blank" rel="noopener" href="https://hexo.io/zh-cn/">https://hexo.io/zh-cn/</a></p>
<h3 id="常用命令"><a href="#常用命令" class="headerlink" title="常用命令"></a>常用命令</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">hexo clean    //hexo cl</span><br><span class="line">hexo generate     //可以hexo g</span><br><span class="line">hexo server    //可以hexo s</span><br><span class="line">hexo deploy   //可以hexo d   推送之前先看配置的远程地址是否配置好</span><br></pre></td></tr></table></figure>

<img src="/rjcs/2021/12/20/%E6%90%AD%E5%BB%BA%E8%87%AA%E5%B7%B1%E7%9A%84%E5%8D%9A%E5%AE%A2/yml%E9%85%8D%E7%BD%AE.jpg" class title="yml配置">

<h3 id="图片无法正确显示（仅供参考-不行的话-再去百度）"><a href="#图片无法正确显示（仅供参考-不行的话-再去百度）" class="headerlink" title="图片无法正确显示（仅供参考  不行的话  再去百度）"></a>图片无法正确显示（仅供参考  不行的话  再去百度）</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">配置 Typora 偏好设置</span><br><span class="line">修改_config.yml中的post_asset_folder，<span class="literal">false</span> 改为 <span class="literal">true</span>，这样修改后，每次 ‘hexo new page’ 生成新文章，都会在文章文件同级目录创建一个与文章文件名同名的文件夹，我们就在这里存放此文章的图片</span><br><span class="line">npm install hexo-asset-img --save</span><br><span class="line">hexo clean &amp;&amp; hexo g &amp;&amp; hexo s</span><br><span class="line">完成安装</span><br></pre></td></tr></table></figure>

<img src="/rjcs/2021/12/20/%E6%90%AD%E5%BB%BA%E8%87%AA%E5%B7%B1%E7%9A%84%E5%8D%9A%E5%AE%A2/%E6%8F%92%E5%85%A5%E5%9B%BE%E7%89%87%E7%9B%B8%E5%85%B3%E8%AE%BE%E7%BD%AE.png" class title="插入图片相关设置">

<h3 id="创建新的文章"><a href="#创建新的文章" class="headerlink" title="创建新的文章"></a>创建新的文章</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo new <span class="string">&quot;name&quot;</span>     //可以hexo n</span><br></pre></td></tr></table></figure>

<p>以上操作都在git bash里操作 </p>
<h3 id="更换主题"><a href="#更换主题" class="headerlink" title="更换主题"></a>更换主题</h3><img src="/rjcs/2021/12/20/%E6%90%AD%E5%BB%BA%E8%87%AA%E5%B7%B1%E7%9A%84%E5%8D%9A%E5%AE%A2/%E5%88%87%E6%8D%A2%E4%B8%BB%E9%A2%98.png" class title="切换主题">





<h3 id="部署到码云上"><a href="#部署到码云上" class="headerlink" title="部署到码云上"></a>部署到码云上</h3><figure class="highlight markdown"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">创建仓库   //路径和名称最后与归属一样</span><br></pre></td></tr></table></figure>

<img src="/rjcs/2021/12/20/%E6%90%AD%E5%BB%BA%E8%87%AA%E5%B7%B1%E7%9A%84%E5%8D%9A%E5%AE%A2/%E5%88%9B%E5%BB%BA%E4%BB%93%E5%BA%93.jpg" class title="创建仓库">

<figure class="highlight markdown"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">申请页面</span><br></pre></td></tr></table></figure>

<img src="/rjcs/2021/12/20/%E6%90%AD%E5%BB%BA%E8%87%AA%E5%B7%B1%E7%9A%84%E5%8D%9A%E5%AE%A2/%E7%94%B3%E8%AF%B7page.jpg" class title="申请page">



<figure class="highlight markdown"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">将地址写入根目录的<span class="emphasis">_config.yml  中的url</span></span><br><span class="line"><span class="emphasis">每次提交代码也要点击更新才会生效</span></span><br></pre></td></tr></table></figure>



<img src="/rjcs/2021/12/20/%E6%90%AD%E5%BB%BA%E8%87%AA%E5%B7%B1%E7%9A%84%E5%8D%9A%E5%AE%A2/%E9%A1%B5%E9%9D%A2%E8%AE%BE%E7%BD%AE.jpg" class title="页面设置">
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>





</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">


<div class="copyright">
  &copy; 
  <span itemprop="copyrightYear">2021</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">CS</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.js.org/muse/" rel="noopener" target="_blank">NexT.Muse</a> 强力驱动
  </div>

    </div>
  </footer>

  
  <script src="https://cdn.jsdelivr.net/npm/animejs@3.2.1/lib/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
<script src="/rjcs/js/comments.js"></script><script src="/rjcs/js/utils.js"></script><script src="/rjcs/js/motion.js"></script><script src="/rjcs/js/schemes/muse.js"></script><script src="/rjcs/js/next-boot.js"></script>

  





  





</body>
</html>
